﻿namespace ConsoleApp15
{
    public class MyClass
    {
        public void InstanceMethod()
        {

        }
    }

    class Program
    {
        static event Action<int> TestEvent;
        static async Task Main()
        {
            int i = 0;
            TestEvent += Program_TestEvent;
            while (true)
            {
                i++;
                TestEvent?.Invoke(i);
                await Task.Delay(1000);
            }
        }

        private static async void Program_TestEvent(int i)
        {
            Console.WriteLine(i);
            await Task.Delay(5000);
            Console.WriteLine(i+"结束");
        }
    }
}
